package com.example.rent.config;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * xss 过滤
 *
 * @author wujiaxing
 * @date 2019-07-10
 */
public class XssFilter implements Filter {


    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request);
        chain.doFilter(xssRequest, response); // 这里使用的是HttpServletRequest的子类
    } @Override public void destroy() { } }
